import React from 'react'
import Taro from '@tarojs/taro'
import {View,Text} from '@tarojs/components'
import {Icon} from '@/components/Icon'
import './index.scss'
interface AddressProps{
    address:any
}

export default (props:AddressProps)=>{
  const {address}=props
  return(
    <View className='xxm-address-com-address' >
      <View className='left'>
        <View className='top'>
          <Text className='name'>
            {address.name}
          </Text>
          <Text className='phone'>
             {address.mobile}
          </Text>
        </View>
        <View className='bottom'>
          {address.is_default===1&&
          <Text className='default'>
              [默认地址]
           </Text>
          }
          <Text className='address'>
            {/* {address.address_detail} */}
            {address.address_name}
            {address.address_description}
          </Text>
        </View>
      </View>
      <View className='right' onClick={()=>Taro.navigateTo({url:`/pages/me/addressDetail/index?id=${address.id}`})}>
        <Icon name='bianji-2' size={32}></Icon>
      </View>
    </View>
  )
}
